package com.jia.product.entity;


import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.jia.commons.valid.AddGroup;
import com.jia.commons.valid.ListValue;
import lombok.Getter;

import static com.jia.product.constants.ProductAttribute.PRODUCT_SALES_STATUS;
import static com.jia.product.constants.ProductAttribute.PRODUCT_UN_SALES_STATUS;

/**
 * 商品属性(Attr)表实体类
 *
 * @author makejava
 * @since 2025-07-08 18:15:25
 */
@Getter
@SuppressWarnings("serial")
@TableName("pms_attr")
public class Attr extends Model<Attr> {
    //属性id
    @TableId
    private Long attrId;
    //属性名
    private String attrName;
    //是否需要检索[0-不需要，1-需要]
    private Integer searchType;
    //属性图标
    private String icon;
    //可选值列表[用逗号分隔]
    private String valueSelect;
    //属性类型[0-销售属性，1-基本属性，2-既是销售属性又是基本属性]
    private Integer attrType;
    //启用状态[0 - 禁用，1 - 启用]
    @ListValue(values = {0, 1}, groups = {AddGroup.class})
    @TableLogic(value = PRODUCT_SALES_STATUS, delval = PRODUCT_UN_SALES_STATUS)
    private Long enable;
    //所属分类
    private Long catelogId;
    //快速展示【是否展示在介绍上；0-否 1-是】，在sku中仍然可以调整
    private Integer showDesc;


    public void setAttrId(Long attrId) {
        this.attrId = attrId;
    }

    public void setAttrName(String attrName) {
        this.attrName = attrName;
    }

    public void setSearchType(Integer searchType) {
        this.searchType = searchType;
    }

    public void setIcon(String icon) {
        this.icon = icon;
    }

    public void setValueSelect(String valueSelect) {
        this.valueSelect = valueSelect;
    }

    public void setAttrType(Integer attrType) {
        this.attrType = attrType;
    }

    public void setEnable(Long enable) {
        this.enable = enable;
    }

    public void setCatelogId(Long catelogId) {
        this.catelogId = catelogId;
    }

    public void setShowDesc(Integer showDesc) {
        this.showDesc = showDesc;
    }


}

